package com.boot.security.server.dao;

import java.util.List;
import java.util.Map;

import com.boot.security.server.model.AppAccount;
import com.boot.security.server.model.AppReportexam;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.boot.security.server.model.AppReportlab;

@Mapper
public interface AppReportlabDao {

    @Select("select * from app_reportlab t where t.id = #{id}")
    AppReportlab getById(Long id);

    @Delete("delete from app_reportlab where id = #{id}")
    int delete(Long id);
    @Select("select * from app_reportlab t ")
    AppReportexam getByinfo(String  cardno);
    int update(AppReportlab appReportlab);
    
    @Options(useGeneratedKeys = true, keyProperty = "id")
    @Insert("insert into app_reportlab(deptid, hostcode, code, name, remark, descs, address, itemname, resultdatetime, result, abnormalindicator, units, reference, patientname, jyitem, jytype, cytime, sqdoctor, diago, jydoctor, checkdoct, cardno, cardtype, idcard, idcardtype) values(#{deptid}, #{hostcode}, #{code}, #{name}, #{remark}, #{descs}, #{address}, #{itemname}, #{resultdatetime}, #{result}, #{abnormalindicator}, #{units}, #{reference}, #{patientname}, #{jyitem}, #{jytype}, #{cytime}, #{sqdoctor}, #{diago}, #{jydoctor}, #{checkdoct}, #{cardno}, #{cardtype}, #{idcard}, #{idcardtype})")
    int save(AppReportlab appReportlab);
    
    int count(@Param("params") Map<String, Object> params);

    List<AppReportlab> list(@Param("params") Map<String, Object> params, @Param("offset") Integer offset, @Param("limit") Integer limit);


    @Select("select * from app_reportlab t" )
    List<AppReportlab> getBylist(@Param("cardno") String cardno  );

}
